<ion-header>
  <ion-toolbar>
    <ion-buttons slot="start">
      <ion-button appDebounceClick (debounceClick)="dismissWithNoImg()" class="text-color-black">
        取消
      </ion-button>
    </ion-buttons>
    <ion-title *ngIf="!img || img.length == 0" class="dlg_title">请选择图片</ion-title>
    <ion-title *ngIf="img.length != 0" class="dlg_title"
      >已选择{{ img.length }}张图片</ion-title
    >
    <ion-buttons slot="end">
      <ion-button appDebounceClick (debounceClick)="dismiss()" class="text-color-orange">
        确定
      </ion-button>
    </ion-buttons>
  </ion-toolbar>
</ion-header>
<ion-content>
  <div *ngIf="isNative" class="plist">
    <ion-grid>
      <ion-row>
        <ion-col
          size="4"
          *ngFor="let i of img; index as pos"
          appDebounceClick (debounceClick)="openImg(pos)"
        >
          <ion-img
            style="object-fit:unset;width:100px;height: 100px;"
            [src]="i.path"
          ></ion-img>
        </ion-col>
        <ion-col
          *ngIf="img.length < imgCount"
          size="4"
          appDebounceClick (debounceClick)="presentAction()"
        >
          <label class="col_add_img">
            <img
              class="add_img_icon"
              src="../assets/icon/Add pictures_icon_style2@3x.png"
            />
            <p class="add_img_font">添加照片</p>
          </label>
        </ion-col>
      </ion-row>
    </ion-grid>
  </div>
  <div *ngIf="!isNative" class="plist">
    <ion-grid>
      <ion-row>
        <ion-col size="4" *ngFor="let i of img; index as pos">
          <img
            style="object-fit:unset;width:100px;height: 100px;"
            src="{{i.path}}"
            appDebounceClick (debounceClick)="openImg(pos)"
          />
        </ion-col>
        <ion-col size="4" *ngIf="img.length < imgCount">
          <input
            id="img_input2"
            type="file"
            accept="image/*"
            name="img_input"
            (change)="uploadFile($event)"
          />
          <label for="img_input2" class="col_add_img">
            <img
              class="add_img_icon"
              src="../assets/icon/Add pictures_icon_style2@3x.png"
            />
            <p class="add_img_font">添加照片</p>
          </label>
        </ion-col>
      </ion-row>
    </ion-grid>
  </div>
</ion-content>
